#include "StdAfx.h"
#include "MsgBoxStatu.h"
#include <Pwinuser.h>
CMsgBoxStatu::CMsgBoxStatu(WCHAR * name):IStatu(name)
{
	m_msgMode=0;
}

bool CMsgBoxStatu::EvaluateClickEvent(const WCHAR* elementName)
{
	if (wcscmp(elementName,L"btn_back") == 0)
		return backClicked();
	if (wcscmp(elementName,L"btn_ok") == 0)
		return OkClicked();
	return false;
}

bool CMsgBoxStatu::backClicked()
{
	GRAPHICMGR.BackState(false);
	return true;
}

bool CMsgBoxStatu::OkClicked()
{   
	switch(m_msgMode)
	{
	case MSGTEXT:
		GRAPHICMGR.BackState(false);
		m_msgMode=0;
		break;
	case MSGNAVIPATH:
        GRAPHICMGR.PostChange(L"navipath");

		break;
	case MSGCALIBRATE:
		TouchCalibrate();
		GRAPHICMGR.BackState(false);
		m_msgMode=0;
		break;
	case MSGRESTORE:
		{
        WCHAR* pBuff;
		bool readed = CGenericFun::ReadOptonsFromDisk(&pBuff);
		GRAPHICMGR.LoadOptions(pBuff);

		GRAPHICMGR.BackState(false);
		
		}break;

	}

	return true;
}